<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
        <meta charset="uft-8">
        <title>发布商品</title>
        <link rel="stylesheet" href="styles/register.css">
		<!--导入jquery-->
		<script src="scripts/jquery-3.3.1.js"></script>
		<script>
		

		$(function () {
			$("#enter").click(function () {
				//alert(111);
				$.post("AdminServlet",$("#upload").serialize(),function (data) {
					if (data != null){
						if (data==1) {
							//跳转到首页
							alert("增加成功");
							//location.href = "index.jsp";
						}
						else{
							alert("错误")
						
						}
					}
				});
			});
		});
					
				

		</script>
    </head>
	<body>
	<!--引入头部-->
	<div id="header"></div>
        <!-- 头部 end -->
    	<div class="rg_layout">
    		<div class="rg_form clearfix">

    			<div class="rg_form_left">

    				<p>发布商品</p>
    				
    			</div>
    			<div class="rg_form_center">

					<div id="errorMsg" style="text-align: center;color: red"></div>
    				<form id="upload" action="authentication" method="post">
						<!--提交处理请求的标识符-->
						
						<input type="hidden" name="action" value="cust">
    					<table style="margin-top: 25px;">
    						<tr>
    							<td class="td_left">
    								<label for="name">商品名称</label>
    							</td>
    							<td class="td_right">
    								<input type="text" id="name" name="name" placeholder="请输入名称">
    							</td>
    						</tr>
    						<tr>
    							<td class="td_left">
    								<label for="sex">图片途径</label>
    							</td>
    							<td class="td_right">
    								<input type="text" id="sex" name="resource" placeholder="请输入路径">
    							</td>
    						</tr>
    						<tr>
    							<td class="td_left">
    								<label for="grader">价格</label>
    							</td>
    							<td class="td_right">
    								<input type="text" id="grader" name="price" placeholder="请输入价格">
    							</td>
    						</tr>
    						<tr>
    							<td class="td_left">
    								<label for="telephone">库存</label>
    							</td>
    							<td class="td_right">
    								<input type="text" id="telephone" name="stock" placeholder="请输入库存">
    							</td>
    						</tr>
    						
    						
    						<tr>
    							<td class="td_left"> 
    							</td>
    							<td class="td_right check"> 
    								<input type="button" class="submit" id="enter" value="提交信息">
									<span id="msg" style="color: red;"></span>
    							</td>
    						</tr>
    					</table>
    				</form>
    			</div>
    			
    		</div>
    	</div>
        <!--引入尾部-->
    	<div id="footer"></div>
		<!--导入布局js，共享header和footer-->
		<script type="text/javascript" src="js/include.js"></script>
    </body>
</html>